home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Oct 89 / Z0058-MABuild "bug"-Oct89 < prev    next >
Encoding:
Text File  |  1989-10-12  |  4.3 KB  |  144 lines  |  [TEXT/GEOL]

  1. Item    9099509                         12-Oct-89        10:46
  2.  
  3. From:   MUYSVASOVIC1                    ER&D - J-D Muys-Vasovic
  4.  
  5. To:     MACAPP.TEST                     MacApp SQA Team
  6.         MACAPP.TECH$                    MACAPP Tech
  7.         APPLE.BUGS                      Apple Bugs Reporting
  8.         MACDTS                          Macintosh Developer Tech. Supt.
  9.  
  10. Sub:    MABuild "bug"
  11.  
  12. I think I found a "feature" of MABuild which I would call a bug.
  13. In short, MABuild's "-d" option doesn't work. Here are the details:
  14.  
  15. I have a compile-time variable called qSA, which allows me to build two
  16. different versions of my MacApp application depending on its value (it is
  17. boolean: qSA can be seen as either true or false). So, I would like to type
  18. something as:
  19.  
  20. MABuild myApp -d qSA
  21. or
  22. MABuild myApp
  23.  
  24. Of course I realized pretty soon that Pascal, and MABuild for that matter needs
  25. either "-d qSA=TRUE" or "-d qSA=FALSE", leading to :
  26.  
  27. MABuild myApp -d qSA=TRUE
  28. or
  29. MABuild myApp -d qSA=FALSE
  30.  
  31. Everything would work OK weren't my myAppl.a assembly file: the problem is that
  32. asm doesn't allow "-d qSA=TRUE" style options. Asm needs "-d qSA=<number>". So
  33. I imagined:
  34.  
  35. MABuild myApp -d qSA=1
  36. or
  37. MABuild myApp -d qSA=0
  38.  
  39. Which doesn't work either because of Pascal. I was stuck. Then I wondered how
  40. qDebug... were handled, and I looked at MABuild soure code. Here is the
  41. corresponding excerpt:
  42.  
  43.    { Debugging support }
  44.    IF fDebug THEN
  45.      BEGIN
  46.      fOptionFlags.Catenate('Db');
  47.  
  48.      fAsmOptions.Catenate(' -d qDebug=1');
  49.      fCOptions.Catenate(' -d qDebug=TRUE');
  50.      fCPlusOptions.Catenate(' -d qDebug=TRUE');
  51.      fMakeOptions.Catenate(' -d qDebug=TRUE');
  52.      fPascalOptions.Catenate(' -d qDebug=TRUE');
  53.      fRezOptions.Catenate(' -d qDebug=TRUE -d Debugging');
  54.    END
  55.    ELSE
  56.    BEGIN
  57.      fAsmOptions.Catenate(' -d qDebug=0');
  58.      fCOptions.Catenate(' -d qDebug=FALSE');
  59.      fCPlusOptions.Catenate(' -d qDebug=FALSE');
  60.    fMakeOptions.Catenate(' -d DebugFiles= -d DebugRsrcs= -d DebugLib= -d
  61.            qDebug=FALSE');{ Eliminate debug files as targets in the makefiles }
  62.    fPascalOptions.Catenate(' -d qDebug=FALSE');
  63.      fRezOptions.Catenate(' -d qDebug=FALSE');
  64.    END;
  65.  
  66. You can see that asm is special cased. Now here is the "-d" option treatment:
  67.  
  68.    kwd:
  69.      BEGIN
  70.      theNextArg := GetNextArg;
  71.  
  72.      fAsmOptions.Catenate(' -d ');
  73.      fAsmOptions.Catenate(theNextArg);
  74.  
  75.      fCOptions.Catenate(' -d ');
  76.      fCOptions.Catenate(theNextArg);
  77.  
  78.   fCPlusOptions.Catenate(' -d ');
  79.    fCPlusOptions.Catenate(theNextArg);
  80.  
  81.    fMakeOptions.Catenate(' -d ');
  82.    fMakeOptions.Catenate(theNextArg);
  83.  
  84.    fPascalOptions.Catenate(' -d ');
  85.      fPascalOptions.Catenate(theNextArg);
  86.  
  87.      fRezOptions.Catenate(' -d ');
  88.      fRezOptions.Catenate(theNextArg);
  89.  
  90.      END;
  91.  
  92. You can see that the option is passed straight thru to all the tools.
  93. Given that MABuild help describe the option as:
  94.  
  95.     -d name=(TRUE|FALSE)    # set compile time variable name in all compilers
  96.  
  97. MABuild should transform "-d qSA=TRUE" into "-d qSA=1", and "-d qSA=FALSE" into
  98. "-d qSA=0". Of course the higher level problem lies in the inconsistency
  99. between the MPW tools. Asm should accept "-d qSA=TRUE" and "-d qSA=FALSE".
  100.  
  101. However, there is a simple fix to the problem which doesn't require changing
  102. MABuild source code. Only change the default asm option in startup from:
  103.  
  104. -Asm '-case on' ∂
  105.  
  106. -Asm '-case on -d FALSE=0 -d TRUE=1' ∂
  107.  
  108. In the same bandwagon, another small inconsistency: in the startup file, the
  109. default are set as:
  110.  
  111. SET MABuildDefaults ∂
  112. "-p ∂
  113. -Asm '-case on' ∂
  114. -Debug ∂
  115. -Make -w ∂
  116. -Rez -rd ∂
  117. -Link -srt ∂
  118. -CPlus '-d SHRT_MAX=32767 -d FALSE=0 -d TRUE=1' ∂
  119. -RenameFlag NmDbInUnPeRaTrTe 'Debug Files' ∂
  120. -RenameFlag S6Cq20FpNmDbInUnPeRaTrTe 'Debug /MacII+Sys6+' ∂
  121. -RenameFlag Te 'Non-Debug Files' ∂
  122. -RenameFlag InTe 'Non-Debug /Inspector' ∂
  123. -RenameFlag S6Cq20FpTe 'Non-Debug /MacII+Sys6+' ∂
  124. -RenameFlag NmDbInUnPeRaTrTeSm 'SADE Debug Files' ∂
  125. -RenameFlag S6Cq20FpNmDbInUnPeRaTrTeSm 'SADE Debug /MacII+Sys6+' ∂
  126. -RenameFlag TeSm 'SADE Non-Debug Files' ∂
  127. -RenameFlag S6Cq20FpTeSm 'SADE Non-Debug /MacII+Sys6+' ∂
  128. -RenameFlag InTeSm 'SADE Non-Debug /Inspector'"
  129. EXPORT MABuildDefaults
  130.  
  131.  
  132. The problem is that there are no C options. I suggest to add the line:
  133.  
  134. -C '-d SHRT_MAX=32767 -d FALSE=0 -d TRUE=1' ∂
  135.  
  136.  
  137. BTW, my config: MacApp 2.0B9, MPW 3.1B1.
  138.  
  139. Regards.
  140.  
  141. Jean-Denis Muys-Vasovic.
  142.  
  143.